Skip to content

Modal → GCP audio separation migration#273

Merged
beveradb merged 15 commits intomainfrom
feat/sess-20260321-2314-modal-gcp-migration
Mar 23, 2026
Merged

Modal → GCP audio separation migration#273
beveradb merged 15 commits intomainfrom
feat/sess-20260321-2314-modal-gcp-migration

Conversation

@beveradb
Copy link
Collaborator

@coderabbitai ignore

Summary

  • Migration plan: deploy audio-separator as Cloud Run GPU service, replacing Modal
  • Adds Dockerfile for Cloud Run, Cloud Run-compatible FastAPI server, ensemble preset API support
  • Implementation will be added to this PR

Scope (this repo)

  • audio_separator/remote/deploy_cloudrun.py — Cloud Run server (adapted from deploy_modal.py)
  • Dockerfile.cloudrun — Docker image for Cloud Run GPU
  • audio_separator/remote/api_client.py — Add preset parameter
  • .github/workflows/deploy-to-cloudrun.yml — CI/CD to Artifact Registry

See docs/archive/2026-03-22-modal-to-gcp-migration-plan.md for full plan.

🤖 Generated with Claude Code

beveradb and others added 15 commits March 22, 2026 00:37
Plan for deploying audio-separator as a Cloud Run GPU service,
replacing the current Modal deployment. Includes ensemble preset
support and Dockerfile for Cloud Run.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- deploy_cloudrun.py: FastAPI server adapted from deploy_modal.py for
  Cloud Run with L4 GPU. Same API contract, in-memory job tracking,
  GCS model download on startup, ensemble preset support.
- Dockerfile.cloudrun: CUDA 12.6 runtime, Python 3.11, FFmpeg, audio-separator[gpu]
- api_client.py: Add `preset` parameter to separate_audio() and
  separate_audio_and_wait() for ensemble preset-based separation
- deploy-to-cloudrun.yml: CI workflow to build and push to Artifact Registry

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Dockerfile: Download ensemble preset models (instrumental_clean +
  karaoke) during build. Eliminates cold-start model download.
- Remove google-cloud-storage dependency (no GCS model download needed)
- CI workflow: Switch to us-east4 (L4 GPU quota approved there)
- Reduce startup probe period (models pre-loaded, startup is fast)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use COPY heredoc + separate RUN instead of inline python -c
which Docker can't parse with internal quotes/newlines.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Use Python 3.12 from deadsnakes PPA (onnxruntime-gpu needs >= 3.11)
- Use apt ffmpeg instead of downloading static build
- Add cloudbuild.yaml for building with baked models on GCP
  (E2_HIGHCPU_32 machine has enough RAM for model loading)
- Update GHA workflow to use Cloud Build instead of local Docker

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Cloud Build's Docker doesn't support BuildKit heredocs (COPY <<).
Use a separate script file instead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds -p/--preset as a mutually exclusive option alongside -m/--model
and --models. Passes preset parameter through to API client.

Usage: audio-separator-remote separate song.mp3 -p instrumental_clean

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When chaining separations (Stage 1 output → Stage 2 input), the input
filename contains stem markers like _(Vocals)_ that confuse the
Separator's stem grouping regex, causing it to only output 1 stem
instead of 2. Strip these markers before processing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@beveradb beveradb merged commit 194f67a into main Mar 23, 2026
32 of 40 checks passed
@beveradb beveradb deleted the feat/sess-20260321-2314-modal-gcp-migration branch March 23, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant